import java.util.Scanner;

public class HW1 {
    public static void main(String[] args) {
        //使用二维数组存储班上五个学生三门功课的考试成绩，要求输出每一个学生的总分、平均分、最高分、最低分
        int total = 0;
        int avg = 0;
        int max, min;
        max = min = 0;
        Scanner input = new Scanner(System.in);
        int[][] student = new int[5][3];
        for (int i = 0; i < 5; i++) {
            total = 0;
            System.out.println("请输入第" + (i + 1) + "个学生的三门成绩:");
            for (int j = 0; j < 3; j++) {
                int num = input.nextInt();
                student[i][j] = num;
                total += student[i][j];
                if (j==0){
                max = min = student[i][0];}
                if (student[i][j] > max) {
                    max = student[i][j];
                }
                if (student[i][j] < min) {
                    min = student[i][j];
                }
            }
            avg = total / 3;
            System.out.println("第"+(i+1)+"学生的总分为：" + total + " 平均分为：" + avg +
                    " 最高分为：" + max + "最低分为：" + min);
        }
    }
}

